package com.agileboot.domain.airport.inspectionUser.db;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 检查人员关联表 服务实现类
 * </p>
 */
@Service
public class SirInspectionUserServiceImpl extends ServiceImpl<SirInspectionUserMapper, SirInspectionUserEntity> implements SirInspectionUserService {
    @Override
    public List<Long> getUserIdByInspectionId(Long inspectionId) {
        // 实现具体逻辑，查询数据库获取用户 ID 列表
        // 这里假设 SirInspectionUserMapper 有对应的方法
        return this.baseMapper.selectUserIdByInspectionId(inspectionId);
    }

    @Override
    public List<SirInspectionUserEntity> getByInspectionIds(List<Long> inspectionIds) {
        if (inspectionIds == null || inspectionIds.isEmpty()) {
            return List.of();
        }
        return this.lambdaQuery()
                .in(SirInspectionUserEntity::getInspectionId, inspectionIds)
                .list();
    }

    @Override
    public int deleteByInspectionIds(List<Long> inspectionIds) {
        if (inspectionIds == null || inspectionIds.isEmpty()) {
            return 0;
        }
        return this.baseMapper.deleteByInspectionIdsPhysically(inspectionIds);
    }
}
